import request from '@/utils/request.js'
const PATH = '/admin/hotel'

// 获取酒店列表
export const getHotelList = ({ page, pageSize, name }) =>
  request.get(PATH + '/pageQuery', { params: { page, pageSize, name } })

// 添加酒店
export const addHotel = (data) => request.post(PATH + '/add', data)

// 删除酒店
export const deleteByIds = (ids) =>
  request.delete(PATH + '/deleteByIds', { params: { ids: ids.join(',') } })

// 修改酒店状态
export const updateStatus = ({ id, status }) =>
  request.put(PATH + `/update/${id}/${status}`)

// 修改酒店信息
export const updateHotel = (data) => request.put(PATH + '/update', data)

/**************************************************************************************/

// 获取酒店规格列表
export const getHotelSpecsList = ({ page, pageSize, hotelId }) =>
  request.get(PATH + '/pageQuerySpecs', { params: { page, pageSize, hotelId } })

// 添加酒店规格
export const addHotelSpecs = (data) => request.post(PATH + '/addSpecs', data)

// 修改酒店规格
export const updateHotelSpecs = (data) =>
  request.put(PATH + '/updateSpecs', data)

// 删除酒店规格
export const deleteHotelSpecsByIds = (ids) =>
  request.delete(PATH + '/deleteSpecsByIds', { params: { ids: ids.join(',') } })
